import axiosInstance from "../axiosInstance";

const commentInfo = {
    /**
     * 分页查询评论
     * @param {{pageIndex,food_name,start_time,end_time}} param0 
     * @returns {Promise<Object>}
     */
    getListByPage({ pageIndex, food_name, start_time, end_time }) {
        return axiosInstance.get("/commentInfo/getListByPage", {
            params: {
                pageIndex, food_name, start_time, end_time
            }
        })
    },
    /**
     * 根据id 删除某一评论
     * @param {id} param0 
     * @returns {Promise<Object>}
     */
    deleteById(id) {
        return axiosInstance.get("/commentInfo/deleteById", {
            params: {
                id
            }
        })
    },
    /**
     * 根据id是否显示评论
     * @param {{id}} param0 
     * @returns {Promise<Object>}
     */
    setCommentShowById({ id }) {
        return axiosInstance.get("/commentInfo/setCommentShowById", {
            params: {
                id
            }
        })
    },
    /**
     * 根据id是否影藏评论
     * @param {{id}} param0 
     * @returns {Promise<Object>}
     */
    setCommentHideById({ id }) {
        return axiosInstance.get("/commentInfo/setCommentHideById", {
            params: {
                id
            }
        })
    }
}

export default commentInfo;